import {ElMessage, ElMessageBox} from 'element-plus'

export function showAlert(title, msg, callback){
    ElMessageBox.alert(msg, title, {
        confirmButtonText: '确定',
        callback: (action) => {
            if (typeof callback === "function"){
                callback()
            }
        }
    })
}

export function showConfirm(title, msg, callback){
    ElMessageBox.confirm( msg, title,
        {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
        }
    ).then(() => {
           if(typeof callback === "function"){
               callback()
           }
    }).catch(() => {
    })
}
